<template>
  <div class="home-group-header" :title="`${name} (${count})`" @click="emit('toggle')">
    <div class="left">
      <span class="arrow">{{ collapsed ? "▶" : "▼" }}</span>
      <span class="name">{{ name }}</span>
    </div>
    <div class="right">
      <span>共 {{ count }} 个索引</span>
    </div>
  </div>
</template>
<script lang="ts" setup>
defineProps<{ name: string; count: number; collapsed: boolean }>();
const emit = defineEmits<{ (e: "toggle"): void }>();
</script>
<style scoped lang="less">
.home-group-header {
  user-select: none;
  cursor: pointer;
  display: flex;
  gap: 8px;

  .arrow {
    display: inline-block;
    width: 18px;
    text-align: center;
  }
}
</style>
